package cn.itcast.erp.entity;

import cn.itcast.erp.annotation.CheckDate;
import cn.itcast.erp.entity.utils.Base;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 供应商实体类
 * @author 罗宇航
 * @date 2019/6/5
 */
@Component
public class Supplier extends Base implements Serializable{
	private Long uuid;//编号
	@NotBlank(message = "名称不能为空")
//	@Pattern(regexp = "[\\u2E80-\\u9FFF]+$",message = "名称不正确")
	private String name;//名称
	private String address;//联系地址
	private String contact;//联系人
	@CheckDate(regexp = "1[345678][0-9]{9}",message = "手机号不符合规则")
	private String tele;//联系电话
	@CheckDate(regexp = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*",message = "邮箱不符合规则")
	private String email;//邮件地址
	private String type;//1：供应商 2：客户
	/**供应商*/
	public static final String TYPE_SUPPLIER="1";
	/**客户*/
	public static final String TYPE_CUSTOMER="2";


	@Override
	public String toString() {
		return "Supplier{" +
				"uuid=" + uuid +
				", name='" + name + '\'' +
				", address='" + address + '\'' +
				", contact='" + contact + '\'' +
				", tele='" + tele + '\'' +
				", email='" + email + '\'' +
				", type='" + type + '\'' +
				'}';
	}

	public Long getUuid() {
		return uuid;
	}
	public void setUuid(Long uuid) {
		this.uuid = uuid;
	}
	public String getName() {		
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAddress() {		
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getContact() {		
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	public String getTele() {		
		return tele;
	}
	public void setTele(String tele) {
		this.tele = tele;
	}
	public String getEmail() {		
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getType() {		
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}

}
